
include( "shared.lua" )
--include( "startupmenu.lua" )

// Clientside only stuff goes here

function ShowTeamMenu()

--   Added because of Draw error (Ophek)
local struc = {}
struc.pos = {}
struc.pos[1] = 100 -- x pos
struc.pos[2] = 200 -- y pos
struc.color = Color(255,0,0,255) -- Red
struc.text = "Hello World" -- Text
struc.font = "DefaultFixed" -- Font
struc.xalign = TEXT_ALIGN_CENTER -- Horizontal Alignment
struc.yalign = TEXT_ALIGN_CENTER -- Vertical Alignment
draw.Text( struc ) --test
--
--Now no errors, but still not print anything to screen (suppose to print 'Hello World')

-- Lua generated by DermaDesigner

local DButton2
local DImageButton2
local DImageButton1
local DPanel3
local DPanel2
local DFrame2

DFrame2 = vgui.Create('DFrame')
DFrame2:SetSize(ScrW() * 0.6569999, ScrH() * 0.80)
DFrame2:SetPos(ScrW() * 0.197, ScrH() * 0.129)
DFrame2:SetTitle("")
DFrame2:SetDraggable(false)
DFrame2:SetBackgroundBlur(true)
DFrame2:SetSizable(false)
DFrame2:SetVisible(true)
DFrame2:ShowCloseButton(true)
DFrame2:SetDeleteOnClose(false)
DFrame2:MakePopup()

DPanel2 = vgui.Create('DPanel')
DPanel2:SetParent(DFrame2)
DPanel2:SetSize(113, 114)
DPanel2:SetPos(63, 53)

DImageButton1 = vgui.Create('DImageButton')
DImageButton1:SetParent(DPanel2)
DImageButton1:SetSize(90, 90)
DImageButton1:Center()
DImageButton1:SetImage('icons/E64x64.vtf')
DImageButton1:SizeToContents()
DImageButton1.DoClick = function() --we should mark the chosen team somehow.
    RunConsoleCommand( "team_2" )
DFrame2:SetVisible(false)
end


DPanel3 = vgui.Create('DPanel')
DPanel3:SetParent(DFrame2)
DPanel3:SetSize(112, 114)
DPanel3:SetPos(233, 53)

DImageButton2 = vgui.Create('DImageButton')
DImageButton2:SetParent(DPanel3)
DImageButton2:SetSize(90, 90)
DImageButton2:Center()
DImageButton2:SetImage('icons/B64x64.vtf')
DImageButton2:SizeToContents()
DImageButton2.DoClick = function() --we should mark the chosen team somehow.
    RunConsoleCommand( "team_1" )
	draw.Text( struc )
 DFrame2:SetVisible(false)
end

end
 -- ALSO part of Draw error fix
 --function GM:HUDPaint()
--    draw.DrawText("Hello World", "ScoreboardText", ScrW() / 2 - 70, ScrH() - 63, Color(255, 255, 255, 255),TEXT_ALIGN_CENTER)
--end
--Didn't work (no printing to the screen)
 
usermessage.Hook( "call_vgui", ShowTeamMenu )
